﻿using System.Collections.Generic;

namespace DL.AI.AIGOAP
{
    //代理目标
    public class AgentGoal
    {
        public string Name { get; }
        //目标优先级
        public float Priority { get; private set; }
        //目标完成的影响
        public HashSet<AgentBelief> DesiredEffects { get; } = new();

        AgentGoal(string name)
        {
            Name = name;
        }
        
        public class Builder
        {
            private readonly AgentGoal m_AgentGoal;

            public Builder(string name)
            {
                m_AgentGoal = new(name);
            }

            public Builder WithPriority(float priority)
            {
                m_AgentGoal.Priority = priority;
                return this;
            }
            
            public Builder WithDesiredEffects(AgentBelief effect)
            {
                m_AgentGoal.DesiredEffects.Add(effect);
                return this;
            }

            public AgentGoal Build() => m_AgentGoal;
         }
        
    }
}